<template>
  <div class="terms-container">
    <!-- 顶部返回按钮 -->
    <div class="top-bar">
      <button @click="handleBack" class="back-btn">
        <svg
          xmlns="http://www.w3.org/2000/svg"
          width="22"
          height="22"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round">
          <path d="m12 19-7-7 7-7" />
          <path d="M19 12H5" />
        </svg>
        <span class="back-text">Back</span>
      </button>
    </div>

    <!-- 内容区 -->
    <main class="terms-content">
      <div class="terms-title-main">Cookie Policy</div>
      <div class="terms-update">Last Updated: October 30, 2025</div>

      <div class="terms-intro">
        A cookie is a small text file stored on your device. We use cookies to:
      </div>

      <!-- 条款列表（直接展示所有内容） -->
      <section class="terms-list">
        <div class="term-item">
          <ul class="term-sub-list">
            <li>
              <strong>- Essential Cookies:</strong>
              Keep you logged in and ensure the security of our site.
            </li>
            <li>
              <strong>- Performance Cookies:</strong>
              Help us understand how you use Nexbie so we can improve it (e.g., Google Analytics).
            </li>
            <li>
              <strong>- Functionality Cookies:</strong>
              Remember your preferences and settings.
            </li>
          </ul>
        </div>
      </section>

      <div class="terms-conclusion">
        You can instruct your browser to refuse all cookies or to indicate when a cookie is being
        sent. However, if you do not accept cookies, you may not be able to use some portions of our
        Service.
      </div>
    </main>
  </div>
</template>

<script setup>
  import { ref } from 'vue';
  import { useRouter } from 'vue-router';

  const router = useRouter();

  // 返回上一页
  const handleBack = () => {
    router.back();
  };
</script>

<style scoped>
  /* 全局样式 */
  .terms-container {
    width: 100%;
    min-height: 100vh;
    background-color: #f8f8f8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 54px;
  }

  /* 顶部返回栏 */
  .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    padding: 0 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
  }

  .back-btn {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin: 0;
    height: 100%;
  }

  .back-btn svg {
    margin-right: 8px;
    color: #f76b1b;
    flex-shrink: 0;
  }

  .back-text {
    transition: color 0.2s ease;
    flex-shrink: 0;
  }

  .back-btn:hover .back-text {
    color: #f76b1b;
  }

  /* 内容区域 */
  .terms-content {
    padding: 0 20px 40px;
    max-width: 800px;
    margin: 0 auto;
  }

  /* 主标题 */
  .terms-title-main {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    line-height: 1.4;
  }

  /* 更新日期 */
  .terms-update {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.8;
  }

  /* 介绍文本 */
  .terms-intro {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 20px;
  }

  /* 条款列表容器 */
  .terms-list {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 28px;
  }

  /* 条款项 */
  .term-item {
    width: 100%;
  }

  /* 列表样式 */
  .term-sub-list {
    margin: 0;
    padding-left: 24px;
  }

  .term-sub-list li {
    font-size: 15px;
    color: #333;
    line-height: 1.9;
    margin-bottom: 16px;
  }

  .term-sub-list li:last-child {
    margin-bottom: 0;
  }

  /* 强调文本样式 */
  .term-sub-list li strong {
    color: #f76b1b;
    font-weight: 600;
  }

  /* 结论部分 */
  .terms-conclusion {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
    padding: 16px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  }

  /* 响应式调整 */
  @media (max-width: 375px) {
    .terms-container {
      padding-top: 50px;
    }

    .top-bar {
      height: 50px;
      padding: 0 16px;
    }

    .terms-content {
      padding: 0 16px 30px;
    }

    .terms-title-main {
      font-size: 19px;
      margin-bottom: 14px;
    }

    .terms-update {
      font-size: 13px;
      margin-bottom: 20px;
      padding-bottom: 12px;
    }

    .terms-intro {
      font-size: 15px;
      line-height: 1.7;
      margin-bottom: 16px;
    }

    .terms-list {
      padding: 16px;
      margin-bottom: 24px;
    }

    .term-sub-list {
      padding-left: 20px;
    }

    .term-sub-list li {
      font-size: 14px;
      line-height: 1.8;
      margin-bottom: 12px;
    }

    .terms-conclusion {
      font-size: 14px;
      padding: 14px;
    }
  }
</style>
